﻿<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>模型管理</title>
    <link rel="stylesheet" href="/plugins/layui/css/layui.css" media="all">
</head>
<body>
<div class="demoTable" style="padding:10px 10px 0px 10px">
    <div class="layui-row">
        <div class="layui-col-xs12">
            <div class="layui-col-xs12" style="padding-right: 2px">
                <fieldset class="layui-elem-field">
                    <legend>模型定义列表</legend>
                    <form class="layui-form" onsubmit="return false;">
                        <div class="layui-field-box">
                            <div class="demoTable" style="padding:10px 10px 0px 10px">
                                <div class="layui-inline">
                                    <input class="layui-input" name="id" id="modelName" autocomplete="off"
                                           placeholder="模型名称">
                                </div>
                                <div class="layui-inline" id="systemDiv">
                                    <select id="belongSystem" name="belongSystem" lay-filter="test"></select>
                                </div>
                                <button class="layui-btn" data-type="reload" id="model_search">查询</button>
                                <button class="layui-btn" data-type="getCheckData" onclick="addModel()">新增</button>
                            </div>
                            <table id="model_list" lay-filter="model" lay-data="{id: 'idModel'}"></table>
                        </div>
                    </form>
                </fieldset>
            </div>
        </div>
        <div class="layui-col-xs12">
            <div class="layui-col-xs12">
                <fieldset class="layui-elem-field">
                    <legend>模型版本（全）</legend>
                    <div class="layui-field-box">
                        <div class="demoTable" style="padding:2px">
                            <div class="layui-inline">
                                <input class="layui-input" name="id" id="modelVersion" autocomplete="off"
                                       placeholder="模型版本">
                            </div>
                            <button class="layui-btn" data-type="versionReload" id="version_search">查询</button>
                        </div>
                        <table id="version_list" lay-filter="version" lay-data="{id: 'version'}"></table>
                    </div>
                </fieldset>
            </div>
        </div>
    </div>
</div>

<script>

    Date.prototype.Format = function (fmt) { //author: meizz
        var o = {
            "M+": this.getMonth() + 1,                 //月份
            "d+": this.getDate(),                    //日
            "h+": this.getHours(),                   //小时
            "m+": this.getMinutes(),                 //分
            "s+": this.getSeconds(),                 //秒
            "q+": Math.floor((this.getMonth() + 3) / 3), //季度
            "S": this.getMilliseconds()             //毫秒
        };
        if (/(y+)/.test(fmt))
            fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
        for (var k in o)
            if (new RegExp("(" + k + ")").test(fmt))
                fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
        return fmt;
    }
</script>


<script type="text/html" id="deployTpl">
    {{#  if(d.deploymentId != '' && d.deploymentId != null){ }}
    <span>已部署</span>
    {{#  } else { }}
    <span>未部署</span>
    {{#  } }}
</script>


<script type="text/html" id="approvalTpl">
    {{#  if(d.isApprove != '' && d.isApprove != null && d.isApprove == '1'){ }}
    <span>通过</span>
    {{# } else  if(d.isApprove != '' && d.isApprove != null && d.isApprove == '2' ){ }}
    <span>不通过</span>
    {{# } else   if(d.isApprove != '' && d.isApprove != null && d.isApprove == '3'){ }}
    <span>提交审核</span>
    {{#  } else { }}
    <span>待提交</span>
    {{#  } }}
</script>

<script type="text/html" id="creTime">
    {{#
    var date = new Date();
    date.setTime(d.creTime);
    return date.Format("yyyy-MM-dd hh:mm:ss");
    }}
</script>
<script type="text/html" id="updTime">
    {{# if(d.updTime == '' || d.updTime == undefined || d.updTime == 'null' || d.updTime == null){ }}

    {{# }else{ }}
    {{#
    var date = new Date();
    date.setTime(d.updTime);
    return date.Format("yyyy-MM-dd hh:mm:ss");
    }}
    {{# } }}
</script>

<script type="text/html" id="verfiactionTpl">
    {{#  if(d.isValidate != '' && d.isValidate != null && d.isValidate == '1'){ }}
    <span>通过</span>
    {{# } else  if(d.isValidate != '' && d.isValidate != null && d.isValidate == '2' ){ }}
    <span>不通过</span>
    {{#  } else { }}
    <span>待验证</span>
    {{#  } }}
</script>

<script type="text/html" id="versionTpl">
    {{#  if(d.versionType != '' && d.versionType != null && d.versionType == '1'){ }}
    <span>正式版</span>
    {{#  } else { }}
    <span>测试版</span>
    {{#  } }}
</script>


<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    <a class="layui-btn layui-btn-xs" lay-event="deploy">版本发布</a>
    <a class="layui-btn layui-btn-xs" lay-event="version">查看版本</a>
    <!--<a class="layui-btn layui-btn-xs" lay-event="export">导出</a>-->
</script>

<script type="text/html" id="start">
    <a class="layui-btn layui-btn-xs" lay-event="startProc">启动</a>
    <a class="layui-btn layui-btn-xs" lay-event="viewImg">查看流程图</a>
</script>


<script src="/plugins/layui/layui.js"></script>
<script src="/src/js/model/model_config.js"></script>
<script src="/src/js/model.js"></script>
</body>
</html>